package com.appspot.modutajataja;

import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.Toast;

public class OptionActivity extends Activity {
	Button option_setting;
	Button option_picture;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_option);

		WebView webViewInfo = (WebView) findViewById(R.id.optionWebView);
		webViewInfo.getSettings().setJavaScriptEnabled(true);
		webViewInfo.loadUrl("file:///android_asset/newsticker/newsticker.html");

		option_setting = (Button) findViewById(R.id.setting);
		option_setting.setOnClickListener(new OptionHandler());

		option_picture = (Button) findViewById(R.id.option_picture);
		option_picture.setOnClickListener(new OptionHandler());
	}

	class OptionHandler implements OnClickListener {

		@Override
		public void onClick(View v) {
			if (v.getId() == R.id.setting) {
				Dialog dialog = new Dialog(OptionActivity.this);
				dialog.setContentView(R.layout.option_setup_dialog);
				dialog.show();
				dialog.setCanceledOnTouchOutside(true);

			} else if (v.getId() == R.id.option_picture) {
				Toast.makeText(OptionActivity.this, "button click", Toast.LENGTH_LONG).show();
			}
		}
	}
};